<span #avatar class="x-avatar" [ngClass]="classMap" [class.x-avatar-error]="isImgError">
  <img *ngIf="src && !isImgError" [src]="src" [style.object-fit]="fit" (error)="imgError()" />
  <x-icon *ngIf="icon" [type]="icon"></x-icon>
  <x-icon *ngIf="isImgError" type="fto-image"></x-icon>
  <span *xOutlet="label; context: { $label: label }">
    {{ label }}
  </span>
</span>
